Skip to content

gRPC: fetchBlock method#6579

Draft
carbolymer wants to merge 8 commits into
masterfrom
mgalazyn/feature/fetchblock
Draft

gRPC: fetchBlock method#6579
carbolymer wants to merge 8 commits into
masterfrom
mgalazyn/feature/fetchblock

Conversation

@carbolymer

@carbolymer carbolymer commented May 25, 2026

Copy link
Copy Markdown
Contributor

Description

Adds the FetchBlock SyncService method to the node's embedded gRPC server, backed by in-process node kernel access (ADR-019).

This PR integrates and tests IntersectMBO/cardano-api#1247, which implements the UTxO RPC transaction mapping that FetchBlock serves.

Node changes:

  • Cardano.Node.Run now publishes a NodeKernelAccess handle to the RPC server through an IORef once the node kernel starts, so FetchBlock reads blocks directly from ChainDB instead of going over a Node-to-Client connection.
  • A new RpcUnsupportedBlockType startup message reports when node kernel access is unavailable for the running block type.
  • SyncService tracing: TraceRpcSync log rendering (FetchBlock request spans, block-not-found, forker errors, kernel access unavailable) and an rpc.request.SyncService.FetchBlock prometheus counter.

Test changes (cardano-testnet-test):

  • New E2E test Cardano.Testnet.Test.Rpc.FetchBlock: submits a payment transaction and a native-script minting transaction over gRPC, locates their blocks, fetches them via FetchBlock and asserts the mapped transaction fields (hash, fee, inputs, outputs, validity, mint, witness set contents) against the submitted values. Also covers the error paths: NOT_FOUND for an unknown block hash and INVALID_ARGUMENT for a malformed one.
  • Rpc.Query now decodes rational protocol parameters with utxoRpcRationalNumberToRational instead of comparing injected encodings.
  • TestnetRuntime.testnetNodes is now NonEmpty, with small cleanups in the other RPC test modules.

Checklist

  • Commit sequence broadly makes sense and commits have useful messages
  • New tests are added if needed and existing tests are updated. These may include:
    • golden tests
    • property tests
    • roundtrip tests
    • integration tests
      See Running tests for more details
  • Any changes are noted in the CHANGELOG.md for affected package
  • The version bounds in .cabal files are updated
  • CI passes. See note on CI. The following CI checks are required:
    • Code is linted with hlint. See .github/workflows/check-hlint.yml to get the hlint version
    • Code is formatted with stylish-haskell. See .github/workflows/stylish-haskell.yml to get the stylish-haskell version
    • Code builds on Linux, MacOS and Windows for ghc-9.6 and ghc-9.12
  • Self-reviewed the diff

Note on CI

If your PR is from a fork, the necessary CI jobs won't trigger automatically for security reasons.
You will need to get someone with write privileges. Please contact IOG node developers to do this
for you.

@carbolymer carbolymer self-assigned this May 25, 2026
@carbolymer
carbolymer requested review from a team as code owners May 25, 2026 17:38
@carbolymer
carbolymer marked this pull request as draft May 25, 2026 17:39
@carbolymer
carbolymer changed the base branch from master to mgalazyn/feature/update-cardano-rpc-11.0 May 25, 2026 17:41
@carbolymer
carbolymer force-pushed the mgalazyn/feature/fetchblock branch from 23eacb3 to 62c6665 Compare May 26, 2026 08:01
@carbolymer
carbolymer force-pushed the mgalazyn/feature/update-cardano-rpc-11.0 branch 3 times, most recently from cdf2c47 to 0535d6e Compare May 26, 2026 14:18
@carbolymer
carbolymer force-pushed the mgalazyn/feature/fetchblock branch 2 times, most recently from 073b75f to 6fe33b6 Compare May 27, 2026 09:59
@carbolymer
carbolymer force-pushed the mgalazyn/feature/update-cardano-rpc-11.0 branch from 48d5fa8 to 476d4cc Compare May 27, 2026 10:28
@carbolymer
carbolymer force-pushed the mgalazyn/feature/fetchblock branch from 6fe33b6 to d62cca2 Compare May 27, 2026 10:59
@carbolymer
carbolymer force-pushed the mgalazyn/feature/update-cardano-rpc-11.0 branch 6 times, most recently from 3ac0ca9 to 7229dec Compare May 28, 2026 11:00
@carbolymer
carbolymer force-pushed the mgalazyn/feature/fetchblock branch 4 times, most recently from e5269c8 to dee76e4 Compare June 1, 2026 14:38
@carbolymer
carbolymer force-pushed the mgalazyn/feature/update-cardano-rpc-11.0 branch from f7f4ffe to 27419dd Compare June 2, 2026 19:54
@carbolymer
carbolymer force-pushed the mgalazyn/feature/fetchblock branch from dee76e4 to 3a7d3d2 Compare June 2, 2026 19:57
@carbolymer
carbolymer force-pushed the mgalazyn/feature/update-cardano-rpc-11.0 branch 3 times, most recently from c3478b4 to 5a916a8 Compare June 17, 2026 08:01
@carbolymer
carbolymer force-pushed the mgalazyn/feature/update-cardano-rpc-11.0 branch 3 times, most recently from 2064644 to 0e48d61 Compare June 18, 2026 10:40
Base automatically changed from mgalazyn/feature/update-cardano-rpc-11.0 to master June 19, 2026 12:45
@carbolymer
carbolymer force-pushed the mgalazyn/feature/fetchblock branch 3 times, most recently from e368fea to 1ca3f9c Compare July 9, 2026 10:43
@carbolymer
carbolymer force-pushed the mgalazyn/feature/fetchblock branch from 1ca3f9c to cd011e7 Compare July 14, 2026 16:35
@carbolymer
carbolymer force-pushed the mgalazyn/feature/fetchblock branch from cd011e7 to dc8adb6 Compare July 16, 2026 16:41
@carbolymer
carbolymer force-pushed the mgalazyn/feature/fetchblock branch from dc8adb6 to 0eee00c Compare July 16, 2026 16:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant